from user import Sprite


hero_blood = int(input('请输入英雄拥有的血量：'))
hero_attack = int(input('请输入英雄具有攻击力：'))
hero = Sprite.Hero('英雄', hero_blood, hero_attack)
monster_blood = int(input('请输入怪兽拥有的血量：'))
monster_attack = int(input('请输入怪兽拥有的攻击力：'))
monster = Sprite.Monster('怪兽', monster_blood, monster_attack)
i = 1
while monster.dead() and hero.dead():
    print('第{}回合'.format(i))
    print('{}当前攻击了{}，扣除的血量为{}'.format(monster.name, hero.name, monster.attack)
    monster.attack(hero)
    print('{}当前攻击了{}，扣除的血量为{}'.format(hero.name, monster.name, hero.attack)
    hero.attack(monster)
    i = i + 1
    if monster.dead():
        print(monster.name + '血量<=0，' + hero.name + '获胜')
    elif hero.dead():
        print(hero.name + '血量<=0，' + monster.name + '获胜')
    else:
        print('双方血量都不够了，本局为平局！')
